Dev/smashing quasar/warnings correction#12
Closed
hermensbas wants to merge 2634 commits intohermensbas:masterfrom
Closed
Dev/smashing quasar/warnings correction#12hermensbas wants to merge 2634 commits intohermensbas:masterfrom
hermensbas wants to merge 2634 commits intohermensbas:masterfrom
Conversation
…erbots#1978) Replace deprecated vsprintf with vsnprintf to eliminate compiler warning and prevent potential buffer overflow. Updated to latest commit. Tested in game and it seemed to log actions just fine. I just basically added a buffer size by using the current vsnprintf lib instead.
) **Original issue:** Bots/Characters received duplicate spells during randomization process. **Root cause:** When `PlayerbotFactory::Randomize` is processed, `InitSkills` is called AFTER `InitAvailableSpells`, which causes the duplicate spells issue because the skillline ability spell is already learned when processing spells from trainers (`InitAvailableSpells`). We simply need to change the order of the randomization process: skills should be handled first, then spells. An alternative approach would be to adjust the skillline abilities and check each spell for every skill, but that seems redundant since we already have checks for the trainer's spells. `InitSkills` -> `SetRandomSkill` -> `SetSkill` -> `learnSkillRewardedSpells` -> `learnSpell` -> duplicate error... **Steps to reproduce:** 1. create common character and login with it 2. set level for this character eq. 80 (`.set level 79`) 3. create and run macro: ``` /g .playerbots bot initself /g .saveall ``` 4. logout -> login and run macro again **Note:** Also added checks for the trainer's spells since `GetSpell` can return nullptr. Updated `LearnQuestSpells` after recent changes and used the same logic and implementation from `Player::learnQuestRewardedSpells`. Yes, we need to cast spells, or we should handle all spell effects that quests/trainers have (for ex.: `SPELL_EFFECT_SKILL_STEP`, `SPELL_EFFECT_UNLEARN_SPECIALIZATION`, `SPELL_EFFECT_BIND`).
Adding a guard against bots that may be registered in `playerBots` variable as selfbot have appeared to crash here. Edit: The exact circumstances that caused the incorrect registration are under investigation as it seems to be 'atypical' behavior.
As requested Poll ``` 1. Yes 2. Yes 3. Maybe, but yes ``` --------- Co-authored-by: Celandriel <22352763+Celandriel@users.noreply.github.com>
…nflict till this is merged) (mod-playerbots#2025) Finalized
In order to make consistent with raids but also to shorten max used length directory for windows builds
…es (mod-playerbots#2028) - Did some basic formatting - Some generated docs - Cleaned header/impl Helper.css - Moved PerfMonitor from util to bot/handler/command Still a freaking mess though, but its a start i guess. Cant ask ppl to add more or make use of those when its so messy.
Added a definition for "AddClass bot" and refined the descriptions for "Randombot" and "Altbot" to better reflect their intended use cases.
This adds the bear form as an alternative form for druids with the cat strategies. This applies to low level (<20) druids that have the cat strategy applied. Reset botAI would not normally give them the strat, because they dont have cat form, but if set, this allows more dps.
…mod-playerbots#1979) Refactor the flightmastercache the bots use for finding the nearest available flight master. I made a small change to how the original function worked by storing the database position for the flightmaster in the cache itself. This allows us to calculate the distance from bot before accessing the creature object, should be faster overall.
…mod-playerbots#2056) Needs second pair of eyes, they appear in crash logs here and there. Its merely a patch on a open wound. ---- As in aslong there multithreads in mapupdate, which we need for decent performance and core calls are not done correctly due various reasons. These type of issues remain. Although i am planning to experiment a little with threadsafe execution of our strategies vs performance. The most effective thing we could do is check every single action and check its stateless and where it does effect the state or read the state of a core object its done in the safest way. flags, worldthread where possible and/ot simply taking into account the state might be invalid.
IsHealAssistantOfIndex() and IsRangedDpsAssistantOfIndex() are supposed to iterate through the group and first return members with the applicable role that have the assistant flag, and then iterate through non-assistants only if there are not enough assistants for the designated index. They are not written properly and actually completely ignore the assistant flag. I rely on these functions for significant roles in SSC and TK (which I have decided I'll PR in the same way as SSC, as a long-term draft). I have them fixed on my own fork, but it is problematic for testers if these functions do not work. So I've done three things here: 1. Fixed the functions to prefer members with the assistant flag. 2. Added a third parameter for ignoreDeadPlayers, like IsAssistTankOfIndex() has. Note that the parameter is by default false for IsAssistTankOfIndex(), meaning dead players are _not_ ignored. This is not my preferred design choice--I think the default should be to ignore dead players, but I have not changed the default and have made the default the same for IsAssistHealOfIndex() and IsAssistRangedDpsOfIndex(), since I don't know the intent of the pre-existing boss strats that use the functions. 3. Changed the names to IsAssistHealOfIndex() and IsAssistRangedDpsOfIndex() so they parallel IsAssistTankOfIndex(), and made corresponding changes in the few boss strats that use the functions. Also, note that the functions _do _not_ exclude real players. I think there are arguments for and against excluding real players. A fourth parameter for this could be useful, but I've not made any change in that regard.
Solve these two problems mod-playerbots#2043 mod-playerbots#1981 @Regrad is the main contributor of the code, while I was just helping to submit the pull request. Express my gratitude to him. After testing, the code is proven to be effective.
Issues: - When you have selfbot enabled and use summon command, you will summon yourself. This causes odd movement if you summon while moving, and can sometimes lead to falling through the floor. - When using the summon command on bots with pets/guardians from a medium distance (like jumping down a ledge then commanding summon), the pets will pathfind run to catch up. This causes them to aggro everything on the way. Solution: Fix summon logic to prevent selfbot summon and ensure pets are teleported with bots. --------- Co-authored-by: bashermens <31279994+hermensbas@users.noreply.github.com>
* fix: Made bots drink responsibly by implementing a real check algorithm on drinking. * fix: Remove a unused variable. * fix: Improved the drinking detection logic following PR comments. * feat: Added inspector pattern to replace distinct functions. * feat: Improved drinking behaviour drastically. * chore: Removed debug action. * chore: Removed remnants of debug code. * fix: Improved DrinkAction::isPossible logic.
* fix: Changed PlayerbotsMgr to be a true Meyer's singleton passed by reference. * fix: Migrated PlayerbotAIConfig to a clean singleton pattern instead of a pointer. * fix: Migrated RandomItemMgr to a clean singleton pattern. * fix: Migrated SharedValueContext to a clean singleton pattern. * fix: Migrated PlayerbotCommandServer to a clean singleton instead of using a pointer. * fix: Migrated PerfMonitor to a clean singleton instead of using a pointer. * fix: Migrated FlightMasterCache to a clean singleton instead of using a pointer. * fix: Migrated PlayerbotDungeonRepository to a clean singleton instead of using a pointer. * fix: Migrated PlayerbotRepository to a clean singleton without using a pointer. * fix: Migrated PlayerbotSpellRepository to a clean singleton instead of using a pointer. * fix: Migrated GuildTaskMgr to a clean singleton instead of using a pointer. * fix: Migrated PlayerbotGuildMgr to a clean singleton instead of using a pointer. * fix: Migrated PlayerbotTextMgr to a clean singletong instead of using a pointer. * fix: Migrated TravelMgr to a clean singleton instead of using a pointer. * fix: Migrated TravelNodeMap to a clean singleton instead of a pointer and removed unused, misleading public constructor on the same class. * fix: Migrated PlayerbotWorldThreadProcessor to a clean singleton instead of using a pointer. * fix: Migrated ServerFacade to a clean singleton instead of a pointer. * chore: Removed unnecessary const from move constructor/operator.
440a3aa to
22504b9
Compare
…t login operation. (#6)
e27b86f to
452fdef
Compare
Updates are only to the config. This PR should be simple. Tl;dr is destro pve spec is using the wrong glyphs. Longer explanation--right now, PreMadeSpecGlyph in the config provides for destro pve spec to use the following Major Glyphs at levels 15, 30, and 80, respectively: Life Tap, Quick Decay, Conflagrate. Quick Decay is useless for destro because destro does not cast Corruption except as a filler instant cast when on the move. Meanwhile, the spec is almost unplayable without Glyph of Conflagrate, so that should not be withheld until level 80. After Conflagrate, there are several viable glyphs, including Life Tap, Incinerate, Immolate, and Imp. I understand Glyph of Life Tap gets worse over time to the point that you don't want to use that glyph in ICC, but that's quite late, and it is useful for the vast majority of the game as a glyph that would actually be available at level 15. I also understand that Glyph of Immolate does not excel until high gear levels. Therefore, I decided to use Incinerate as the default level 80 glyph. The new order for default glyphs for destro pve for levels 15, 30, and 80 is Life Tap, Conflagrate, and Incinerate, respectively. I also made a couple of other very minor fixes in the config. No impact on performance or AI, obviously. Sidenote: Glyph of Conflagrate is not available at level 30--it requires level 40, so from 30 to 40, InitGlyphs() will plug in a random glyph for the second Major slot. This issue applies to many specs, and it's not avoidable unless InitGlyphs() is broken up into level brackets, which I think is not worthwhile. I think the better approach for glyphs is to ensure the right ones are applied at high levels, but with an attempt to make them usable at lower levels too where possible. (cherry picked from commit 00d19db) Co-authored-by: Crow <pengchengw@me.com>
…during the refactor.
452fdef to
d5f1983
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Pull Request
Describe what this change does and why it is needed...
Design Philosophy
We prioritize stability, performance, and predictability over behavioral realism.
Complex player-mimicking logic is intentionally limited due to its negative impact on scalability, maintainability, and
long-term robustness.
Excessive processing overhead can lead to server hiccups, increased CPU usage, and degraded performance for all
participants. Because every action and
decision tree is executed per bot and per trigger, even small increases in logic complexity can scale poorly and
negatively affect both players and
world (random) bots. Bots are not expected to behave perfectly, and perfect simulation of human decision-making is not a
project goal. Increased behavioral
realism often introduces disproportionate cost, reduced predictability, and significantly higher maintenance overhead.
Every additional branch of logic increases long-term responsibility. All decision paths must be tested, validated, and
maintained continuously as the system evolves.
If advanced or AI-intensive behavior is introduced, the default configuration must remain the lightweight decision
model. More complex behavior should only be
available as an explicit opt-in option, clearly documented as having a measurable performance cost.
Principles:
Stability before intelligence
A stable system is always preferred over a smarter one.
Performance is a shared resource
Any increase in bot cost affects all players and all bots.
Simple logic scales better than smart logic
Predictable behavior under load is more valuable than perfect decisions.
Complexity must justify itself
If a feature cannot clearly explain its cost, it should not exist.
Defaults must be cheap
Expensive behavior must always be optional and clearly communicated.
Bots should look reasonable, not perfect
The goal is believable behavior, not human simulation.
Before submitting, confirm that this change aligns with those principles.
Feature Evaluation
Please answer the following:
How to Test the Changes
Complexity & Impact
Does this change add new decision branches?
Does this change increase per-bot or per-tick processing?
Could this logic scale poorly under load?
Defaults & Configuration
If this introduces more advanced or AI-heavy logic:
AI Assistance
If yes, please specify:
AI assistance is allowed, but all submitted code must be fully understood, reviewed, and owned by the contributor.
Any AI-influenced changes must be verified against existing CORE and PB logic. We expect contributors to be honest
about what they do and do not understand.
Final Checklist
Notes for Reviewers
Anything that significantly improves realism at the cost of stability or performance should be carefully discussed
before merging.